<!--
 * @Description: 
 * @Author: Sun
 * @Date: 2019-08-19 21:24:52
 * @LastEditors: Sun
 * @LastEditTime: 2019-08-25 16:06:10
 -->

<template>
	<div class="textdeom" ref="elememt2"  >
		<input type="text"
			class="input-class"
			placeholder="防抖的预习"
			@input="changvalue($event,'nihao','index','tm')"
		>
	<input type="text"
			class="input-class"
			placeholder="节流的预习"
			@input="chang($event,'nihao1','index1','tm1')"
		>

	</div>

</template>

<script>
import { _debounce,de,the,fnThrottle,debounce,_throttle } from "@/models/public";
export default {
	name:"Jieliu",
	props: {

	},
	data(){
		return{

		}
	},
	created () {

	
	},
	methods: {
		// changvalue:de((e)=>{
		// 	let sm=e.target.value
		//  	this.changinput(sm)
		// },2000),

		changvalue:de(function(e,a,b,c){
		let sm=e.target.value
		console.log(e,a,b,c)
		 this.changinput(sm,a,b,c)
		},2000),

		changinput(data,a,b,c){
			console.log("我是防抖="+data,a,b,c)
			console.log("我是防抖="+a,b,c)
		},

		chang: _throttle(function(e,a,b,c){
			let sm=e.target.value
			this.jied(sm,a,b,c)
		},2000), 
		jied(data,a,b,c){
			console.log("我是函数节流"+data+a,b,c)
		},




	},
	computed:{
		
	},
	watch:{
	
	},
	components:{

  }
	
}

</script>

<style  scoped >
.input-class{
	width: 200px;
	height: 40px;
	margin: 30px;
	line-height: 40px;
	font-size: 14px; 
}
</style>
